<template>
	<view>
		<view class="btn btnDraw" @click="handleDraw()">点击抽奖（演示事件上报）</view>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	onUnload() {
		this.unloadEvent()
	},
	methods: {
		handleDraw(){
			wx.showLoading({
				title:'加载中'
			})
			this.$dhtrack.trackEvent('draw',{
				'key':'恭喜你，获得一等奖！'
			})
			setTimeout(()=>{
				wx.hideLoading()
				wx.showToast({
					icon:'none',
					title:'恭喜你，获得一等奖！',
					mask: true
				})
			},1000)
		}
	}
};
</script>

<style>
	.btn{
		background-color: #ccc;border: 1px solid #ccc;height: 50px;line-height: 50px;
		margin: 20px;
		text-align: center;
	}
	.btnDraw{
		margin-top: 20px;
		background-color: #2f85fc;
		color: #fff;
	}
</style>
